<?php
require_once('include/lsamp_curl.php');
require_once('config.php');
$errno = 0;
$error = '';
//login and retrieve cookie
$vs_manager = new lsamp_cURL(TRUE,'cookies.txt','gzip','',$webmin_vs_url);
$login_data = "user=" . $webmin_account['user'] . "&pass=" . $webmin_account['pass'] . "&save=1&path=/";
$result = $vs_manager->get($webmin_login_url, $errno, $error);
$result = $vs_manager->post($webmin_login_url, $login_data, $errno, $error);
if($errno !== 0){
	die("Error: " . $error);
}
//display form to select a user

$table = '<table align="center" width="100%"><tr align="center"><td>logged in as: ' . $webmin_account["user"] . '</td></tr>'
. '<tr align="center"><td>';
$form = '<form id="select_user" action="routing.php" method="GET" ><br>'
. '<lable> Select a domain owner: </lable><select id="owner" name="owner">';
foreach($webmin_parent_users as $user){
	$form .= "<option value=\"$user\" >$user";
};
$form .= '</select>';
$form .= '<label> Action: </label><select id="action" name="action"><br>';
$form .= '<option value="Add">Add';
$form .= '<option value="Delete">Delete';
$form .= '</select>'
.'<input type="submit" value="Go"/><br>'
.'</form>';
$table .= $form ;
$table .= '</td></tr></table>';
echo $table;
